#include <bits/stdc++.h>
#define FOR(i,s,e) for (int i=(s); i<(e); i++)
#define FOE(i,s,e) for (int i=(s); i<=(e); i++)
#define FOD(i,s,e) for (int i=(s)-1; i>=(e); i--)
#define CLR(a,x) memset(a, x, sizeof(a))
#define EXP(i,l) for (int i=(l); i; i=qn[i])
#define LLD long long
#define RI(x) scanf("%d", &x)
#define RL(x) scanf("%lld", &x)
#define PB push_back
using namespace std;
#define MUL_CASE 1
const int N = 100005;
int a[N];
void solve(){
int n, m;
RI(n), RI(m);
FOE(i,1,n) RI(a[i]);
int sum = 0;
set<int> S;
FOE(i,1,n){
if (a[i] == 1) S.insert(i);
sum += a[i];
}
while (m--){
int op, target, x, v;
RI(op);
if (op == 1){
RI(target);
int ok = 0;
if (target > sum) ;
else if (S.size() == 0){
if ((sum - target) % 2 == 0) ok = 1;
}
else{
int t = min(*S.begin() - 1, n - *S.rbegin());
int x = sum - 2*t;
if (target <= x || (sum - target) % 2 == 0) ok = 1;
}
puts(ok ? "YES" : "NO");
}
if (op == 2){
RI(x), RI(v);
if (a[x] == 1) S.erase(x);
sum -= a[x];
a[x] = v;
sum += a[x];
if (a[x] == 1) S.insert(x);
}
}
}
int main(){
int TC = 1;
if (MUL_CASE) RI(TC);
while (TC--) solve();
return 0;
}
150. Evaluate Reverse Polish Notation | 144. Binary Tree Preorder Traversal |
137. Single Number II | 130. Surrounded Regions |
129. Sum Root to Leaf Numbers | 120. Triangle |
102. Binary Tree Level Order Traversal | 96. Unique Binary Search Trees |
75. Sort Colors | 74. Search a 2D Matrix |
71. Simplify Path | 62. Unique Paths |
50. Pow(x, n) | 43. Multiply Strings |
34. Find First and Last Position of Element in Sorted Array | 33. Search in Rotated Sorted Array |
17. Letter Combinations of a Phone Number | 5. Longest Palindromic Substring |
3. Longest Substring Without Repeating Characters | 1312. Minimum Insertion Steps to Make a String Palindrome |
1092. Shortest Common Supersequence | 1044. Longest Duplicate Substring |
1032. Stream of Characters | 987. Vertical Order Traversal of a Binary Tree |
952. Largest Component Size by Common Factor | 212. Word Search II |
174. Dungeon Game | 127. Word Ladder |
123. Best Time to Buy and Sell Stock III | 85. Maximal Rectangle |